#include <iostream>
#include <vector>
#include <complex>
#include "ber.h"
#include "spec.h"
#include "decision.h"

int main(int argc, char** argv)
{
    using namespace std;

    typedef vector<complex<double> > Signal;
    typedef vector<Signal> SignalSystem;
    
    Signal v1 = {complex<double>(1, 1), 0,                      0};
    Signal v2 = {0,                     complex<double>(1, -1), 0};
    Signal v3 = {complex<double>(1, -1),   0, complex<double>(2, -2)};
    
    SignalSystem sys = {v1, v2, v3};

    OutBandEmission outBandEmission;
    BitErrorRate bitErrorRate;
        
    cout << outBandEmission(sys, 0.1) << endl;
    cout << bitErrorRate(sys, 0.2) << endl;
    
    TypeMap<double, int, double> map;
    map.set<int>(0);
    map.set<double>(1);
    
    cout << map.get<int>() << " " << map.get<double>() << endl;
    
    Decision
    <
        Minimize<OutBandEmission>,
        Minimize<BitErrorRate>
    > decision;
    
    cout << decision(sys) << endl;
    sys[2][1] = 1;
    cout << decision(sys) << endl;
}
